<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
	<head>
		<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
		<title>
			Document
		</title>
		<link rel="stylesheet" type="text/css" href="{{__PUBLIC__}}/Bootstrap/Css/bootstrap.min.css"/>
		<link rel="stylesheet" type="text/css" href="{{__PUBLIC__}}/hdjs/hdjs.css"/>
    	<script type="text/javascript" src="{{__PUBLIC__}}/Admin/jquery-1.8.2.min.js"></script>
    	<script type="text/javascript" src="{{__PUBLIC__}}/hdjs/hdjs.min.js"></script>
	</head>
	<body>
		<form onsubmit="return hd_submit(this,'{{U('GoodsLists/index')}}','{{U('GoodsLists/index',array("gid"=>Q("get.gid")))}}')">
		<table class="table table-bordered table-hover" style="font-size: 14px;">
			<tbody>
				<tr>
					<th>货品ID</th>
						{{foreach from="$arr" value="$v"}}
							<th>{{$v[0]['taname']}}</th>
						{{endforeach}}
					<th>库存</th>
					<th>货号</th>
					<th>操作</th>
				</tr>
				{{foreach from="$gListsData" value="$Lists_v"}}
				<tr class="info">
					<td>{{$Lists_v['glid']}}</td>
						{{foreach from="$Lists_v['combine']" value="$com_v"}}
						<td>{{$com_v}}</td>	
						{{endforeach}}
					<td>{{$Lists_v['artnum']}}</td>
					<td>{{$Lists_v['inventory']}}</td>
					<td>
						<a href="{{U('GoodsLists/edit',array('glid'=>$Lists_v['glid'],'gid'=>$Lists_v['goods_lists_gid']))}}" class="btn btn-warning">
							<i class="icon-pencil icon-white">
							</i>修改</a>
						<a href="javascript:;" onclick="if(confirm('确认要删除吗？亲~~')) location.href='{{U("GoodsLists/del",array("glid"=>$Lists_v["glid"],"gid"=>$Lists_v["goods_lists_gid"]))}}'" class="btn btn-danger">
							<i class="icon-trash icon-white">
							</i>删除</a>
					</td>
				</tr>
				{{endforeach}}
				<!-- 如果已添加数目小于可能情况数目，才出现添加货品的输入框 -->
				<tr class="info">
					<td>添加货品</td>
					{{foreach from="$arr" value="$arr_v"}}
					<td>
						<select name="spec[]" required="">
							<option value="0">-请选择-</option>
								{{foreach from="$arr_v" value="$vv"}}
							<option value="{{$vv['gaid']}}">{{$vv['gavalue']}}</option>
								{{endforeach}}
						</select>
					</td>
					{{endforeach}}
					<td>
						<input type="text" name="artnum">
					</td>
					<td>
						<input type="text" name="inventory" value="货号自动生成" id="inventory" disabled="disabled">
					</td>
					<script type="text/javascript">
						$(function(){
							$('#inventory').attr('disabled',true);
						})
					</script>
					<td>
					</td>
				</tr>
			</tbody>
		</table>
		<input type="hidden" name="goods_gid" value="{{Q('get.gid',0,'intval')}}"/>
		<input type="submit" value="确认添加" class="btn btn-primary btn-block btn-large">
		</form>
	</body>
</html>